package com.zyzd.general.module.recyclerview.edit;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.zyzd.general.R;
import com.zyzd.general.entity.local.UserEntity;
import com.zyzd.retrofit.base.BaseRecyclerFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class EditRecyclerFragment extends BaseRecyclerFragment<EditRecyclerPresenter, EditRecyclerAdapter, UserEntity> implements EditRecyclerContract.IView {

    @Override
    protected EditRecyclerPresenter createPresenter() {
        return new EditRecyclerPresenter();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.item_recycler_edit_add;
    }

    @Override
    public EditRecyclerAdapter createAdapter() {
        return new EditRecyclerAdapter(getContext());
    }

    @Override
    protected void initData() {
        super.initData();
        mPresenter.loadData(true);
    }

    public static EditRecyclerFragment getInstance() {
        return new EditRecyclerFragment();
    }

    @Override
    public boolean isEnableLoadMore() {
        return false;
    }

    @Override
    public boolean isAutoRefresh() {
        return false;
    }

    @Override
    public boolean isEnableRefresh() {
        return false;
    }

    @OnClick(R.id.btn_add)
    public void onViewClicked() {
        mAdapter.add(new UserEntity());
    }
}
